<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>意向岗位管理</title>
	<meta name="description" content="这是一个 index 页面">
	<meta name="keywords" content="index">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="renderer" content="webkit">
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="icon" type="image/png" href="${ctx}/assets/i/favicon.png">
	<link rel="apple-touch-icon-precomposed" href="${ctx}/assets/i/app-icon72x72@2x.png">
	<meta name="apple-mobile-web-app-title" content="Amaze UI" />
	<link rel="stylesheet" href="${ctx}/assets/css/amazeui.datatables.min.css" />
	<script src="${ctx}/assets/js/echarts.min.js"></script>
	<link rel="stylesheet" href="http://cdn.amazeui.org/amazeui/2.7.2/css/amazeui.min.css" />
	<script src="https://cdn.bootcss.com/jquery/2.2.3/jquery.js"></script>
	<link rel="stylesheet" href="${ctx}/assets/css/app.css">
</head>

<body data-type="widgets">
	<script src="${ctx}/assets/js/theme.js"></script>
	<div class="am-g tpl-g">
		<!-- 内容区域 -->
		<div class="row-content">
			<div class="row-content am-cf">
				<div class="row">
					<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
						<div class="widget am-cf">
							<div class="widget-head am-cf">
								<div class="widget-title  am-cf">意向岗位管理</div>
							</div>
							<div class="widget-body  am-fr">
								<div class="am-u-sm-12">
									<table id="example"
										class="am-table am-table-compact am-table-striped tpl-table-black">
										<thead>
											<tr>
												<th>id</th>
												<th>学号</th>
												<th>姓名</th>
												<th>部门</th>
												<th>班别</th>
												<th>首选岗位</th>
												<th>次选岗位</th>
												<th>备选岗位</th>
												<th>手机号码</th>
												<th>操作</th>
											</tr>
										</thead>
										<tfoot>
											<tr>
												<th>id</th>
												<th>学号</th>
												<th>姓名</th>
												<th>部门</th>
												<th>班别</th>
												<th>首选岗位</th>
												<th>次选岗位</th>
												<th>备选岗位</th>
												<th>手机号码</th>
												<th>操作</th>
											</tr>
										</tfoot>
									</table>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- 
	<script src="${ctx}/assets/js/amazeui.min.js"></script>
	 -->
	<script src="http://cdn.amazeui.org/amazeui/2.7.2/js/amazeui.min.js"></script>
	<script src="${ctx}/assets/js/amazeui.datatables.min.js"></script>
	<script src="${ctx}/assets/js/dataTables.responsive.min.js"></script>
	<script src="${ctx}/assets/js/app.js"></script>

	<script type="text/javascript">
		$(document).ready(function() {
			$('#example').dataTable({
				"processing" : true,
				"serverSide" : true,
				"ajax" : {
					"type" : "POST",
					"url" : "getData",
					"data" : {},
				},
				"fnInitComplete":function(){
		            // 重置iframe高度
		            window.parent.frameResize();
		        },
				 "columns": [ //表格要显示的列定义(字段名称做了处理)
	                    { "data": "id", "visible":false },
	                    { data: "student",
	                      render: function(data, type, row,meta){
	                    	  if(data==null){
				            		return '';
				            	}
				            	else{
				            		return data.id;
				            	}
	                      }
	                    },
	                    { data: "student",
		                      render: function(data, type, row,meta){
		                    	  if(data==null){
					            		return '';
					            	}
					            	else{
					            		return data.name;
					            	}
		                      }
		                },
		                { data: "student",
		                      render: function(data, type, row,meta){
		                    	  if(data==null){
					            		return '';
					            	}
					            	else{
					            		return data.dept;
					            	}
		                      }
		                },
		                { data: "student",
		                      render: function(data, type, row,meta){
		                    	  if(data==null){
					            		return '';
					            	}
					            	else{
					            		return data.clazz;
					            	}
		                      }
		                 },
	                    { data: "firstJob",
	                      render: function (data, type, row, meta) {
	                    	  if(data==null){
				            		return '';
				            	}
				            	else{
				            		return data.name;
				            	}
	                      }
	                    },
	                    { data: "secondJob",
		                  render: function (data, type, row, meta) {
		                	  if(data==null){
				            		return '';
				            	}
				            	else{
				            		return data.name;
				            	}
		                  }
		                },
		                { data: "thirdJob",
			              render: function (data, type, row, meta) {
			            	if(data==null){
			            		return '';
			            	}
			            	else{
			            		return data.name;
			            	}
			              }
			            },
			            {data:"cellphone"}
	                    //其余字段定义省略
	            ],
	            "aaSorting": [ //指定排序的列（索引从0开始）及规则
                   [2, "desc" ]
                 ],
	          //自定义字段
				columnDefs:[
					{
                    	targets: 9,
                    	render: function (data, type, row, meta) {
                   			return '<a class="am-btn" href="update?id='+ row.id + '">修改</a>'
           						+ '<a class="am-btn" href="delete?id='+ row.id + '">删除</a>';
	                    }
	                },
	                { "orderable": false, "targets": 9 }
	            ]
			});
		})
	</script>
</body>

</html>